import request from '../request.ts'

// 标记作弊行为
export const markCheating = (data) => {
  return request({
    url: '/cheating/mark',
    method: 'post',
    data
  })
}

// 检测答案相似度
export const detectSimilarity = (data) => {
  return request({
    url: '/cheating/detect-similarity',
    method: 'post',
    data
  })
}

// 获取作弊记录
export const getCheatingRecords = (params) => {
  return request({
    url: '/cheating/records',
    method: 'get',
    params
  })
}

// 获取作弊统计
export const getCheatingStatistics = (params) => {
  return request({
    url: '/cheating/statistics',
    method: 'get',
    params
  })
}

// 处理作弊举报
export const handleCheatingReport = (reportId, data) => {
  return request({
    url: `/cheating/reports/${reportId}/handle`,
    method: 'post',
    data
  })
}

// 获取实时监控数据
export const getMonitoringData = (params) => {
  return request({
    url: '/cheating/monitoring',
    method: 'get',
    params
  })
}

// 设置防作弊规则
export const setAntiCheatingRules = (data) => {
  return request({
    url: '/api/cheating/rules',
    method: 'post',
    data
  })
}

// 获取防作弊规则
export const getAntiCheatingRules = () => {
  return request({
    url: '/api/cheating/rules',
    method: 'get'
  })
}
